Skip to content

Add PushAmount trait to track the reason behind a push#2846

Closed
t-bast wants to merge 2 commits into
masterfrom
push-amount-trait
Closed

Add PushAmount trait to track the reason behind a push#2846
t-bast wants to merge 2 commits into
masterfrom
push-amount-trait

Conversation

@t-bast
Copy link
Copy Markdown
Member

@t-bast t-bast commented Mar 29, 2024

We have the ability to push some funds to our peer when opening a channel or splicing. This is generally used between LSPs and wallets to pay fees for on-the-fly funding, but can also be used for many other reasons.

We introduce a dedicated trait for that field instead of using a plain amount: that allows carrying more data than just an amount, and provides better insights of why some funds were pushed.

This is purely a refactoring at that point, without any logical changes.

NB: this builds on top of #2845

t-bast added 2 commits March 29, 2024 11:38
The channel initiator traditionnally pays the commit tx fees, but we may
want to override that when providing services to wallet users. We thus
split the current `isInitiator` flag into two flags:

- `isChannelOpener`
- `payCommitTxFees`

We always set `payCommitTxFees` to the same value as `isChannelOpener`.
Custom feature bits may override that behavior if necessary.

Note that backwards compatibity is preserved since our previous `bool8`
codec encodes `true` as `0xff` and `false` as `0x00`.
We have the ability to push some funds to our peer when opening a
channel or splicing. This is generally used between LSPs and wallets
to pay fees for on-the-fly funding, but can also be used for many other
reasons.

We introduce a dedicated trait for that field instead of using a plain
amount: that allows carrying more data than just an amount, and provides
better insights of why some funds were pushed.

This is purely a refactoring at that point, without any logical changes.
@t-bast t-bast requested a review from pm47 March 29, 2024 16:06
@t-bast t-bast marked this pull request as draft June 4, 2024 09:30
@t-bast t-bast removed the request for review from pm47 June 4, 2024 09:30
@t-bast
Copy link
Copy Markdown
Member Author

t-bast commented Jun 12, 2024

We won't use push_amount in the latest version of on-the-fly funding.

@t-bast t-bast closed this Jun 12, 2024
@t-bast t-bast deleted the push-amount-trait branch June 12, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant